/**
 * 会员Service
 */
package com.kerrykidz.membership.service.impl;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kerrykidz.membership.dao.mapper.CusMemHisEntityMapper;
import com.kerrykidz.membership.dao.model.CusMemHisEntity;
import com.kerrykidz.membership.service.IMemHisService;
import com.kerrykidz.sales.dao.model.PosOrderEntity;
import com.rdp.framework.exception.RDPException;

/**
 * @author YJJ
 *
 */
@Service
public class MemHisServiceImpl implements IMemHisService {
	
	@Autowired
	CusMemHisEntityMapper cusMemHisEntityMapper;

	/**
	 * 修改会员会员
	 * @param memberId
	 * @throws RDPException
	 * @date: 2014年8月15日
	 */
	public void saveMemHisEntity(CusMemHisEntity cusMemHisEntity) throws RDPException {
		cusMemHisEntityMapper.saveEntity(cusMemHisEntity);
	}

	public CusMemHisEntity findEntityByMembId(String memberId, String hisType) throws RDPException {
		return cusMemHisEntityMapper.findEntityByMembId(memberId, hisType);
	}

	public void updateEntityByMembId(CusMemHisEntity cusMemHisEntity) throws RDPException {
		cusMemHisEntityMapper.updateEntityByMembId(cusMemHisEntity);
	}

	public String findOrderByMembId(String fkMemId) {
		return cusMemHisEntityMapper.findOrderByMembId(fkMemId);
	}

	/**
	 * 是否退单记录数
	 * @param memberId
	 * @throws RDPException
	 * @date: 2014年11月27日
	 */
	public Integer getBackOrderCount(@Param("memberId") String memberId) throws RDPException {
		return cusMemHisEntityMapper.getBackOrderCount(memberId);
	}

}
